package com.space.job;

import com.space.service.FlightService;
import org.apache.log4j.Logger;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * @author : 港某
 * @date : 2020/2/14 9:36
 */
@DisallowConcurrentExecution
public class FlightJob extends QuartzJobBean{

    private Logger log = Logger.getLogger(this.getClass());

    private FlightService fs;

    public void setFs(FlightService fs) {
        this.fs = fs;
    }

    @Override
    protected void executeInternal(JobExecutionContext arg0){
        log.info("------------------航班job开始------------------");
        fs.updateFlightStartStatusId();
        fs.updateFlightEndStatusId();
        log.info("------------------航班job结束------------------");
    }
}
